'use strict';
angular.module('nec-admin', [
    'ui.router',
    'ngResource',
    'ui.bootstrap',
    'nec-admin.common',
    'nec-admin.login',
    'nec-admin.user',
    'nec-admin.admin',
    'nec-admin.teacher',
    'nec-admin.student'
])
    .config(['$urlRouterProvider', '$locationProvider', '$httpProvider', 'authServiceProvider',
        function($urlRouterProvider, $locationProvider, $httpProvider, authServiceProvider) {
            /*html5mode will be true, when release,
             this is auto build, don't need modify*/
            $locationProvider.html5Mode(false);
            $httpProvider.interceptors.push('httpRequestInterceptor');
            authServiceProvider.setAuthStatus(true);
            $urlRouterProvider
                .when('/admin', '/admin/hello')
                .when('/teacher', '/teacher/hello')
                .otherwise('login');
        }
    ])
    .run(['$rootScope', 'authService', 'regexService', function ($rootScope, authService, regexService) {
        authService.init('login');
        $rootScope.regex = regexService;
    }]);
